aclp region and group_by changes#807
Conversation
|
An integration test for region 'TestRegions_pgLimits' is failing because the code expects 'Placement Group' not to be present at index 0, which ideally is not the case. I'm not sure why it was written this way, so haven't modified it. |
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the monitoring capabilities of the Linode API client by adding monitor services to region information and extending dashboard widget functionality. The changes support ACLP (Analytics, Control Plane) monitoring features.
- Adds Monitors field to regions containing supported alert and metrics services
- Extends dashboard widgets with group_by and filters fields for better data aggregation
- Enhances monitor services to include alert configuration details
Reviewed Changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/region_test.go | Added tests for monitors field in region responses |
| test/unit/monitor_services_test.go | Enhanced tests for alert details and fixed service type tests |
| test/unit/monitor_dashboards_test.go | Added tests for group_by and filters widget fields |
| test/unit/fixtures/*.json | Updated fixtures with monitors data, alert configurations, and widget fields |
| test/integration/regions_test.go | Added integration test for monitors section validation |
| test/integration/monitor_services_test.go | Enhanced service validation and test structure |
| test/integration/monitor_dashboards_test.go | Added widget field validation for group_by and filters |
| test/integration/fixtures/*.yaml | Updated integration fixtures with monitors data |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 23 out of 24 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Can you please fix the lint issue reported by the workflow? |
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 24 out of 25 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
The lint issue is not fixed: https://github.com/linode/linodego/actions/runs/17945547628/job/51053708173?pr=807 Looks just some format issues. Could you run |
I dont see lint issues related to monitor changes. |
We recently updated the linter so it generated some new requirements. You can have them fixed by merging the main and fix the conflicts correspondingly. |
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 20 out of 25 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| // GetMonitorServiceByType gets a monitor service by a given service_type | ||
| func (c *Client) GetMonitorServiceByType(ctx context.Context, serviceType string) (MonitorService, error) { | ||
| e := formatAPIPath("monitor/services/%s", serviceType) | ||
| return getPaginatedResults[MonitorService](ctx, c, e, opts) | ||
|
|
||
| result, err := doGETRequest[MonitorService](ctx, c, e) | ||
|
|
||
| if result == nil { | ||
| return MonitorService{}, err | ||
| } | ||
|
|
||
| return *result, err | ||
| } |
There was a problem hiding this comment.
The function now returns a single MonitorService instead of a list, but the API path and behavior should be validated. Consider documenting this breaking change from ListMonitorServiceByType to GetMonitorServiceByType in the commit message or PR description.
There was a problem hiding this comment.
The solution more consistent with our standards would be to make this function return a pointer (*MonitorService) returning the results of doGETRequest directly 👍
lgarber-akamai
left a comment
There was a problem hiding this comment.
This looks great, thank you for the contribution!
Once #807 (comment) has been addressed this should be ready to go 🎉
📝 Description
✔️ How to Test
How do I run the relevant unit/integration tests?
unit tests
make test-unit TEST_ARGS="-run TestListMonitorServices"
make test-unit TEST_ARGS="-run TestListMonitorDashboards"
make test-unit TEST_ARGS="-run TestListRegions"
Integration test
make test-int TEST_ARGS="-run TestMonitorServices_Get_smoke"
make test-int TEST_ARGS="-run TestMonitorDashboards_Get_smoke"
make test-int TEST_ARGS="-run TestRegionsMonitorsSection"